Question: There is only one value of $k$ for which the line $x=k$ intersects the graphs of $y=x^2+6x+5$ and $y=mx+b$ at two points which are exactly $5$ units apart. If the line $y=mx+b$ passes through the point $(1,6)$, and $b\neq 0$, find the equation of the line.  Enter your answer in the form "$y = mx + b$".
The line $x=k$ intersects $y=x^2+6x+5$ at the point $(k, k^2+6k+5)$ and the line $y=mx+b$ at the point $(k,mk+b)$. Since these two points have the same $x$-coordinate, the distance between them is the difference of their $y$-coordinates, so we have $$|(k^2+6k+5)-(mk+b)|=5.$$ Simplifying, this gives us two quadratic equations: $k^2+(6-m)k+5-b=5$ and $k^2+(6-m)k+5-b=-5$. We can express these as  \begin{align*}
k^2+(6-m)k-b=0&\quad(1)\\
k^2+(6-m)k+10-b=0.&\quad(2)
\end{align*} We know that all solutions to both of these equations will be places where the line $y=mx+b$ is a vertical distance of $5$ from the parabola, but we know there can only be one such solution! Thus there must be exactly $1$ solution to one of the equations, and no solutions to the other equation. We find the discriminants ($b^2-4ac$) of the equations, so for equation $(1)$ the discriminant is $(6-m)^2-4(1)(-b)=(6-m)^2+4b$. For equation $(2)$ the discriminant is $(6-m)^2-4(1)(10-b)=(6-m)^2+4b-40$. One of these equations must equal zero, and one must be less than zero. Since $-40<0$, adding $(6-m)^2+4b$ to both sides doesn't change the inequality and $(6-m)^2+4b-40<(6-m)^2+4b$, so the greater value must be equal to zero so that the lesser value is always less than zero. Thus we have $(6-m)^2+4b=0$.

We are also given that the line $y=mx+b$ passes through the point $(1,6)$, so substituting $x=1$ and $y=6$ gives $6=(1)m+b$ or $m+b=6$. This means that $6-m=b$, so we can substitute in the above equation: \begin{align*}
(6-m)^2+4b&=0\quad\Rightarrow\\
(b)^2+4b&=0\quad\Rightarrow\\
b(b+4)&=0.
\end{align*} We are given that $b\neq 0$, so the only solution is $b=-4$. When we plug this into the equation $m+b=6$, we find $m-4=6$ so $m=10$. Thus the equation of the line is $y=mx+b$ or $\boxed{y=10x-4}$.